//
//  BaseNavigationController.m
//  BiliBiliDemo
//
//  Created by XDH on 16/4/12.
//  Copyright © 2016年 XDH. All rights reserved.
//

#import "BaseNavigationController.h"

@implementation BaseNavigationController


+(void)initialize {
    //设置NavigationBar的背景图片
    UINavigationBar *bar = [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[BaseNavigationController class]]];
    //设置高度
    
    
    //生成一张白色图片
    CGFloat w = [UIScreen mainScreen].bounds.size.width;
    CGRect rect = CGRectMake(0, 0, w,64);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
    CGContextFillRect(context, rect);
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    //设置图片
    [bar setBackgroundImage:img forBarMetrics:UIBarMetricsDefault];
    
    //去掉底部黑线
    [bar setShadowImage:[[UIImage alloc] init]];
    
//    NSDictionary *dict = [[NSDictionary alloc] init];
//    dict[@"]
//    bar.titleTextAttributes
    
    /************移除返回按钮的文字*****************/
    //获取按钮
    UIBarButtonItem *item = [UIBarButtonItem appearance];
    //设置item文字向上偏移
    [item setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -64) forBarMetrics:UIBarMetricsDefault];
    

    
}


@end
